<template>
  <h1>响应式原理</h1>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  name: "reactiveTheory",
  setup() {
    const binner = {
      meal: "tacos",
    };
    const handler = {
      get(target, prop, recevier) {
        return Reflect.get(target, prop, recevier);
      },
      set(target, key, value, recevier) {
        const val = Reflect.set(target, key, value, recevier);
        console.log(val);
        return val;
      },
    };

    const proxy = new Proxy(binner, handler);
    console.log(proxy.meal);
  },
});
</script>

<style scoped>
</style>
